﻿using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;

namespace SZ.Mech
{
    public class CompProperties_UseEffectIncident : CompProperties_UseEffect
    {
        public IncidentDef incidentDef;

        public CompProperties_UseEffectIncident()
        {
            compClass = typeof(CompUseEffect_Incident);
        }

    }
    public class CompUseEffect_Incident : CompUseEffect
    {
        private CompProperties_UseEffectIncident Props => (CompProperties_UseEffectIncident)props;
        public override void DoEffect(Pawn usedBy)
        {
            base.DoEffect(usedBy);

            //IncidentParmsUtility
            IncidentParms incidentParms = new IncidentParms();
           

          
            incidentParms.target = usedBy.Map;
            incidentParms.points = StorytellerUtility.DefaultThreatPointsNow(incidentParms.target) * 2.5f;
            incidentParms.faction = Find.FactionManager.FirstFactionOfDef(SZ_DefOf.SZ_HeavenForgedCelestiall);

            Props.incidentDef.Worker.TryExecute(incidentParms);
        }
    }

}
